package com.woniuxy.learnmap.mapper;

import com.woniuxy.commons.dto.RouteDto;
import com.woniuxy.commons.dto.RouteSearchDto;
import com.woniuxy.commons.entity.Route;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Auther: 王敞
 * @E-mail： 365799712@qq.com
 * @Date: 2020/07/16/18:56
 * @Description:路径mapper
 */
@Mapper
@Repository
public interface RouteMapper {
    /*
    *
     * @Description: 新增一条路径
     * @Param: [route]
     * @return: int
     * @Author: 王敞
     * @Date: 18:57 2020/7/16
     **/
    public int addRoute(Route route);
    /*
    *
     * @Description: 通过name来查询路径
     * @Param: [name]
     * @return: com.woniuxy.commons.entity.Route
     * @Author: 王敞
     * @Date: 17:50 2020/7/17
     **/
    public Route findRouteByName(String name);
    /*
    *
     * @Description: 通过路径id查询路径
     * @Param: [rid]
     * @return: com.woniuxy.commons.entity.Route
     * @Author: 王敞
     * @Date: 15:08 2020/7/30
     **/
    public Route findRouteByRid(int rid);
    /*
    *
     * @Description:
     * @Param: [index, pageSize]
     * @return: java.util.List<com.woniuxy.commons.dto.RouteDto>
     * @Author: 王敞
     * @Date: 14:16 2020/7/31
     **/
    public List<RouteDto> findRoutesByPage(RouteSearchDto routeSearchDto);
    /*
    *
     * @Description: 查询路径总数
     * @Param: []
     * @return: int
     * @Author: 王敞
     * @Date: 15:25 2020/7/31
     **/
    public int findTotalNumsOfRoutes(RouteSearchDto routeSearchDto);
    /*
    *
     * @Description: 逻辑删除学习路径，即将状态设置成2
     * @Param: [routeId]
     * @return: void
     * @Author: 王敞
     * @Date: 11:20 2020/7/30
     **/
    public void deleteRouteById(int routeId);
}
